<?php
	class Model_msearch extends database{
		protected $_table = "tbl_products";
		protected $_cate  = "tbl_category";
		public function search($key){
			$sql = "select * from $this->_table where pro_name LIKE '%$key%' ";
			$this->query($sql);
			return $this->fetchAll();
		}
		public function total_pro($key){
			$sql = "select * from $this->_table where pro_name LIKE '%$key%'";
			$this->query($sql);
			return $this->num_rows();
		}
		public function list_cate(){
			$sql = "select * from $this->_cate where cate_status = '1' order by cate_id DESC";
			$this->query($sql);
			return $this->fetchAll();
		}
	}
?>